load("@fbsource//tools/build_defs:rust_binary.bzl", "rust_binary")
load("//eden/mononoke/facebook:lib.bzl", "tokio_dependency_test")

oncall("scm_server_infra")

rust_binary(
    name = "lfs_server",
    srcs = glob(["src/**/*.rs"]),
    test_deps = [
        "fbsource//third-party/rust:pretty_assertions",
        "fbsource//third-party/rust:tokio",
        "//common/rust/shed/fbinit:fbinit-tokio",
        "//eden/mononoke/blobstore:memblob",
        "//eden/mononoke/blobstore:readonlyblob",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_types:mononoke_types-mocks",
        "//eden/mononoke/repo_factory:test_repo_factory",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-trait",
        "fbsource//third-party/rust:bytes",
        "fbsource//third-party/rust:clap",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:futures-util",
        "fbsource//third-party/rust:gotham",
        "fbsource//third-party/rust:gotham_derive",
        "fbsource//third-party/rust:http",
        "fbsource//third-party/rust:hyper-0-14",
        "fbsource//third-party/rust:hyper-openssl",
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:mime",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:openssl",
        "fbsource//third-party/rust:pin-project",
        "fbsource//third-party/rust:rand",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tracing",
        "//common/network/rust/network_util:network_util",
        "//common/rust/shed/cached_config:cached_config",
        "//common/rust/shed/cloned:cloned",
        "//common/rust/shed/facet:facet",
        "//common/rust/shed/fbinit:fbinit",
        "//common/rust/shed/hostname:hostname",
        "//common/rust/shed/secure_utils:secure_utils",
        "//common/rust/shed/stats:stats",
        "//common/rust/shed/time_ext:time_ext",
        "//configerator/structs/scm/mononoke/lfs_server:lfs_server_config-rust",
        "//eden/mononoke/blobstore:blobstore",
        "//eden/mononoke/blobstore:redactedblobstore",
        "//eden/mononoke/cmdlib/caching:cmdlib_caching",
        "//eden/mononoke/cmdlib/mononoke_app:mononoke_app",
        "//eden/mononoke/common/connection_security_checker:connection_security_checker",
        "//eden/mononoke/common/metadata:metadata",
        "//eden/mononoke/common/ods_counters:ods_counters",
        "//eden/mononoke/common/scuba_ext:scuba_ext",
        "//eden/mononoke/gotham_ext:gotham_ext",
        "//eden/mononoke/lfs_protocol:lfs_protocol",
        "//eden/mononoke/metaconfig:metaconfig_types",
        "//eden/mononoke/mononoke_configs:mononoke_configs",
        "//eden/mononoke/mononoke_macros:mononoke_macros",
        "//eden/mononoke/mononoke_repos:mononoke_repos",
        "//eden/mononoke/mononoke_types:mononoke_types",
        "//eden/mononoke/permission_checker:permission_checker",
        "//eden/mononoke/rate_limiting:rate_limiting",
        "//eden/mononoke/repo_attributes/filestore:filestore",
        "//eden/mononoke/repo_attributes/repo_blobstore:repo_blobstore",
        "//eden/mononoke/repo_attributes/repo_identity:repo_identity",
        "//eden/mononoke/repo_attributes/repo_permission_checker:repo_permission_checker",
        "//eden/mononoke/repo_authorization:repo_authorization",
        "//eden/mononoke/server/context:context",
        "//eden/mononoke/time_window_counter:time_window_counter",
        "//eden/scm/lib/clientinfo:clientinfo",
        "//eden/scm/lib/repo/url:repourl",
    ],
)

tokio_dependency_test(
    name = "tokio_check",
    rule = ":lfs_server",
)
